Package edu.claflin.finder
Class Global
java.lang.Object
edu.claflin.finder.Global
Holds "Global" data that needs to be accessed by multiple parts of the
program. Should a piece of data, like the LogUtil reference or the output
directory, need to be shared by multiple parts of the program it will be
stored here. This is a static class and requires no instantiation.
- Version:
- 3.1 May 28, 2015
- Author:
- Charles Allen Schultz II
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateGlobal()Private constructor for preventing instantiation of the class. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidDestroys the LogUtil reference.static LogUtilGets the logger.static FileGets the output directory for storing results.static voidmakeLogger(LogLevel maxGranularity, boolean[] fileLogs, boolean[] terminalLogs) Instantiates the logger field.static booleanSets the output directory for storing results.
-
Field Details
-
logger
The LogUtil reference used for logging data in the program. -
output
The output directory for storing results. Defaults to the working directory.
-
-
Constructor Details
-
Global
private Global()Private constructor for preventing instantiation of the class.
-
-
Method Details
-
makeLogger
Instantiates the logger field.- Parameters:
maxGranularity- the maximum granularity of the log messages.fileLogs- the boolean array indicating file log settings.terminalLogs- the boolean array indicating terminal output settings.
-
destroyLogger
public static void destroyLogger()Destroys the LogUtil reference. Calls the destroy() method on the logger field if the logger field is not null. -
getLogger
Gets the logger.- Returns:
- the LogUtil reference used for logging in the program.
-
setOutput
Sets the output directory for storing results.- Parameters:
file- the File representing the new output directory.- Returns:
- a boolean indicating if the output directory was successfully set.
-
getOutput
Gets the output directory for storing results.- Returns:
- the File representing the output directory.
-